﻿Ext.define('Happy.navigation.shell.view.WorkPanel', {
    extend: 'Ext.tab.Panel',
    alias: 'widget.shell-work-panel',
    requires: ['Happy.iframe.Panel'],

    showMenuItem: function (record) {
        var me = this;

        var item = me.getComponent(record.raw.Id);
        if (!item) {
            item = me.add({
                xtype: 'happy-iframe-panel',
                itemId: record.raw.Id,
                title: record.raw.Title,
                src: record.raw.Url,
                closable: true
            });
        }

        me.setActiveTab(item);
    }
});